package com.adderis.soft.domain.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author Reda
 * @version 1.0
 * @created 20-avr.-2014 22:47:44
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "methode", catalog = "adderis")
public class Methode implements java.io.Serializable {

	private int methodeId;
	private String methode;
	private Date createtimestamp;
	private String statutcode;
	private Date updatetimesstamp;
	private Date deletiontimesstamp;
	private Set<Cloudpoint> cloudpoints = new HashSet<Cloudpoint>(0);

	public Methode() {
	}

	public Methode(int methodeId) {
		this.methodeId = methodeId;
	}

	public Methode(int methodeId, String methode) {
		this.methodeId = methodeId;
		this.methode = methode;
	}

	public Methode(String methode) {
		this.methode = methode;
	}

	public Methode(String methode, Set<Cloudpoint> cloudpoints) {

		this.methode = methode;
		this.cloudpoints = cloudpoints;
	}

	@Column(name = "createdatetime")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreatetimestamp() {
		return createtimestamp;
	}

	public void setCreatetimestamp(Date createtimestamp) {
		this.createtimestamp = createtimestamp;
	}

	@Column(name = "statutcode", length = 10)
	public String getStatutcode() {
		return statutcode;
	}

	public void setStatutcode(String statutcode) {
		this.statutcode = statutcode;
	}

	@Column(name = "updatedatetime")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdatetimesstamp() {
		return updatetimesstamp;
	}

	public void setUpdatetimesstamp(Date updatetimesstamp) {
		this.updatetimesstamp = updatetimesstamp;
	}

	@Column(name = "deletiondatetime")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getDeletiontimesstamp() {
		return deletiontimesstamp;
	}

	public void setDeletiontimesstamp(Date deletiontimesstamp) {
		this.deletiontimesstamp = deletiontimesstamp;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "methodeID", unique = true, nullable = false)
	public int getMethodeId() {
		return this.methodeId;
	}

	public void setMethodeId(int methodeId) {
		this.methodeId = methodeId;
	}

	@Column(name = "Methode", length = 100)
	public String getMethode() {
		return this.methode;
	}

	public void setMethode(String methode) {
		this.methode = methode;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "methodes")
	public Set<Cloudpoint> getCloudpoints() {
		return cloudpoints;
	}

	public void setCloudpoints(Set<Cloudpoint> cloudpoints) {
		this.cloudpoints = cloudpoints;
	}

}
